package com.itheima.service;

import com.itheima.domain.Product;
import com.itheima.service.fallback.ProductServiceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author MI
 * @ClassName ProductService.java
 * @createTime 2021年11月16日 22:34:00
 * fallback 指明当前代码的容错类
 * fallback 和 fallbackFactory 使用一个即可
 */
@FeignClient(value = "service-product",
        // fallback = ProductServiceFallback.class,
        fallbackFactory = ProductServiceFallbackFactory.class
)
public interface ProductService {


    @RequestMapping("/product/{pid}")
    Product product(@PathVariable("pid") Integer pid);
}
